package org.idea.qiyu.alarm.starter.config;

import org.idea.qiyu.alarm.starter.event.WebExceptionErrorEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author linhao
 * @Date created in 7:10 下午 2021/7/13
 */
@Component
public class WebExceptionListener  implements ApplicationListener<WebExceptionErrorEvent> {

    private static final Logger LOGGER = LoggerFactory.getLogger(WebExceptionListener.class);

    @Override
    public void onApplicationEvent(WebExceptionErrorEvent webExceptionErrorEvent) {
        String errorContent = String.valueOf(webExceptionErrorEvent.getSource());
        LOGGER.error("监听器捕获：" + errorContent);
    }

}
